package jfxtras.scene.control;


import java.math.BigInteger;

public interface SpinnerXDataProvider<T>
{
	/**
	 * Calculate the previous index given the provided one.
	 * 
	 * @param idx the current idx, if null is specified assume "positive endless" and return the value before that (being the maximum idx)
	 * @return idx, or null if there is no previous
	 */
	public BigInteger getPreviousIdx(BigInteger idx);

	/**
	 * Calculate the next index given the provided one.
	 * 
	 * @param idx the current idx, if null is specified assume "negative endless" and return the value ater that (being the minimum idx)
	 * @return idx, or null if there is no previous
	 */
	public BigInteger getNextIdx(BigInteger idx);
	
	/**
	 * Return the value for the specified index, this may be null
	 * 
	 * @param idx
	 * @return
	 */
	public T getValue(BigInteger idx);
	
	/**
	 * Return the idx for the specified value, this may be null is the value is invalid
	 * 
	 * @param idx
	 * @return
	 */
	public BigInteger getIdx(T value);
}
